﻿namespace Vdc.Grid
{
    using System;
    using System.Web.UI;
    using System.Web.UI.WebControls;

    public abstract class GridContainerWithText : WebControl
    {
        protected string innerText;

        protected GridContainerWithText()
        {
        }

        protected override void RenderContents(HtmlTextWriter writer)
        {
            if (!string.IsNullOrEmpty(this.innerText))
            {
                Literal child = new Literal {
                    Text = this.Text
                };
                this.Controls.Add(child);
            }
            try
            {
                base.RenderContents(writer);
            }
            catch
            {
            }
        }

        public string Text
        {
            get
            {
                return this.innerText;
            }
            set
            {
                this.innerText = value;
            }
        }
    }
}

